<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>登录-虎居农产品.餐饮.本地生活外卖极速达</title>
    <link type="text/css" rel="stylesheet" th:href="@{/css/style.css}"/>
    <script type="text/javascript" th:src="@{/scripts/function.js}"></script>

    <link th:href="@{/css/binodal.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/iconfont.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/site-base.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/main.css}" rel="stylesheet" 0="app\assets\AppAsset">

    <link rel="shortcut icon" th:href="@{/shop_pc/images/favicon.ico}">

    <script language="JavaScript" th:src="@{/js/jquery-1.10.2.min.js}"></script>
    <script language="JavaScript" th:src="@{/js/jquery.cookie.js}"></script>
    <script language="JavaScript" th:src="@{/js/superslide.js}"></script>
    <script language="JavaScript" th:src="@{/js/main.js}"></script>
    <script language="JavaScript" th:src="@{/js/layer.js}"></script>
    <script type="text/javascript" th:src="@{/js/function.js}"></script>
</head>
<body>
<!--header-->
<div class="login-header">
    <div class="w1190">
        <div class="logo">
            <a title="外卖新鲜极速送—上虎居网上商城" href="/">
                <img alt="外卖新鲜极速送—上虎居网上商城" th:src="@{/picture/logo.png}">
            </a>
            <h2 title="购买新鲜—上虎居网上商城直卖网">用户登录-虎居农产品.餐饮.本地生活外卖极速达</h2>
        </div>
        <a title="外卖新鲜极速送—上虎居网上商城" class="fr" href="/">
            商城首页
        </a>
    </div>
</div>

<div class="login-main">
    <div class="hdBox">
        <a target="_blank" title="C-PC 登录首页广告位" th:href="@{/user/to_reg}">
            <img alt="C-PC 登录首页广告位" th:src="@{/picture/1d7bc60afffc4743bf448162787cf018.gif}" />
        </a>
    </div>
    <div class="loginBox slideTxtBox">
        <strong>虎居用户登录</strong>

        <div class="hd">
            <ul>
                <li class="on">
                    密码登录
                    <span class="arrow"></span>
                </li>
            </ul>
        </div>
        <div class="bd">
            <div class="bd-box paw_log">
                <div class="tips-box box_1" style="display:none;">
                    <i></i>
                    <span></span>
                </div>
                <form id="loginForm" method="post" th:action="@{/user/login}">
                <ul>
                    <tr>
                    <li>
                        <input type="text" placeholder="用户名"  id="mobile" name="euUserName" />
                    </li>
                    </tr>
                    <li>
                        <input type="password" placeholder="密码" id="password" name="euPassword"/>
                    </li>

                </ul>
                <input type="submit" id="userLogin" class="log-btn"value="立即登录">
                </form>
                <p class="zc">

                    <span class="fr">
                        还没有账号？
                        <a target="_blank" title="立即注册" th:href="@{/user/to_reg}">
                            立即注册
                        </a>
                    </span>
                </p>
            </div>
        </div>
    </div>
</div>



<script language="JavaScript">
    var mobileOBJ=$("#mobile");
    var passwordOBJ=$("#password");
    var codeOBJ=$("#code");
    var boxMsgOBJ=$('.tips-box');
    var boxMsg1OBJ=$('.box_1');

    var mobileNoteOBJ=$('#mobile-note');
    var codeNoteOBJ=$('#code-note');
    var smscodeNoteOBJ=$('#smscode-note');
    var boxMsg2OBJ=$('.box_2');
    var isLogin=false;
    var isSmsLogin=false;
    var pawLogOBJ = $('#userLogin');
    var noteLogOBJ = $('#noteLogin');
    var token = 'cb2972c306a04a13b0ea';
    var beinvitedMobileOBJ = $('.msgLoginYzm');
    var myIntval = '';

    function load()
    {
        $.ajax({
            url: '/site/login-qr',
            type: 'post',
            data: {
                login_token: token,
                _csrf: 'LovQoGHvB3uINFaok2yOke3xHegpOabMDElnae7Vnpp94rbPG7c2IvAFL8n-KPbjmKYljWRL8qJ7OzMAn4Drqw=='
            },
            dataType: 'json',
            success: function(json) {
                if(json['ret'] == 200 && json['isLogin'] && json['isLogin'] == 1) {
                    if('https://www.huju168.com/experience') {
                        window.location.href='https://www.huju168.com/experience';
                    } else {
                        window.location.href='/';
                    }
                }
            },
            error: function(reg) {}
        });
    }

    $(function(){
        $(".yzm").find("img").click();
        $('.hd').on('click', 'li', function() {
            var _this = $(this);
            if($('.qrbox').hasClass('on')) {
                //设置每隔1000毫秒执行一次load() 方法
                myIntval=setInterval(function(){load()},3000);
            } else {
                clearInterval(myIntval);
            }
        });

        //手机号验证
        mobileOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckPhone(boxMsg1OBJ,val);
        });
        mobileNoteOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckPhone(boxMsg2OBJ,val);
        });

        //密码验证
        passwordOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckPassword(boxMsg1OBJ,val);
        });

        //验证码验证
        codeOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckCode(boxMsg1OBJ,val,'loginCode');
        });
        codeNoteOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckCode(boxMsg2OBJ,val,'code_note');
        });


        //短信验码验证
        smscodeNoteOBJ.blur(function(){
            var _this=$(this);
            var val=_this.val();
            submCheckSms(boxMsg2OBJ,val);
        });

        //短信登录
        $('#noteLogin').click(function(){
            if(!isSmsLogin){
                isSmsLogin=true;
                var mobile=mobileNoteOBJ.val();
                var code=codeNoteOBJ.val();
                var smscode=smscodeNoteOBJ.val();

                if(!submCheckPhone(boxMsg2OBJ,mobile)){
                    isSmsLogin=false;
                    return false;
                }else if(!submCheckCode(boxMsg2OBJ,code)){
                    isSmsLogin=false;
                    return false;
                }else if(!submCheckSms(boxMsg2OBJ,smscode)){
                    isSmsLogin=false;
                    return false;
                }

                $.post('/site/sms-login',{mobile:mobile,code:code,smscode:smscode, _csrf: 'LovQoGHvB3uINFaok2yOke3xHegpOabMDElnae7Vnpp94rbPG7c2IvAFL8n-KPbjmKYljWRL8qJ7OzMAn4Drqw=='},function(json){
                    if(json['ret'] == 200) {
                        if('https://www.huju168.com/experience') {
                            window.location.href='https://www.huju168.com/experience';
                        } else {
                            window.location.href='/';
                        }

                    } else {
                        isSmsLogin=false;
                        boxMsg(boxMsg2OBJ,json['msg']);
                    }
                });
            }

        });

        //密码登录
        $('#userLogin').click(function(){
            var _this = $(this);
            if(!isLogin){
                isLogin=true;
                var mobile=mobileOBJ.val();
                var password=passwordOBJ.val();
                var code=codeOBJ.val();

                if(!submCheckPhone(boxMsg1OBJ,mobile)){
                    isLogin=false;
                    return false;
                }else if(!submCheckPassword(boxMsg1OBJ,password)){
                    isLogin=false;
                    return false;
                }else if(!submCheckCode(boxMsg1OBJ,code)){
                    isLogin=false;
                    return false;
                }

                $.ajax({
                    url: '/login.html',
                    type: 'post',
                    data: {
                        mobile:mobile,
                        password:password,
                        code:code,
                        _csrf: 'LovQoGHvB3uINFaok2yOke3xHegpOabMDElnae7Vnpp94rbPG7c2IvAFL8n-KPbjmKYljWRL8qJ7OzMAn4Drqw=='
                    },
                    dataType: 'json',
                    beforeSend: function(ret) {
                        _this.css({'pointer-events': 'none'});
                    },
                    complete: function(ret) {
                        _this.css({'pointer-events': 'auto'});
                    },
                    success: function(json) {
                        if(json['ret'] == 200) {
                            if(json['data']['is_activity'] != 1) {
                                if('https://www.huju168.com/experience') {
                                    window.location.href='https://www.huju168.com/experience';
                                } else {
                                    window.location.href='/';
                                }

                            } else {
                                $('#activedMobile').val(mobile);
                                $('.activate').show();
                            }

                        } else {
                            isLogin=false;
                            boxMsg(boxMsg1OBJ,json['msg']);
                        }
                    },
                    error: function(reg) {
                        console.log(reg);
                    }
                });
            }

        });

        /**
         * 激活登录
         * */
        $('#userActivedLogin').click(function() {
            var _this = $(this);

            var mobile = $('#activedMobile').val(); // 手机号
            var code = $('#activedCode').val(); // 验证码
            var smscode = $('#activedSmscode').val(); // 短信验证码
            if($.trim(mobile)==''){
                layer.msg('请输入手机号');
            }else if(!checkMobile(mobile)){
                layer.msg('手机格式错误');
            } else if($.trim(code)==''){
                layer.msg('请输入验证码');
            }else if(code.length!=4){
                layer.msg('验证码长度必须4位');
            } else if($.trim(smscode)==''){
                layer.msg('请输入验证码');
            } else {
                $.ajax({
                    url: '/site/be-actived-login',
                    type: 'post',
                    data: {
                        mobile:mobile,
                        code:code,
                        smscode:smscode,
                        _csrf: 'LovQoGHvB3uINFaok2yOke3xHegpOabMDElnae7Vnpp94rbPG7c2IvAFL8n-KPbjmKYljWRL8qJ7OzMAn4Drqw=='
                    },
                    dataType: 'json',
                    beforeSend: function(ret) {
                        _this.css({'pointer-events': 'none'});
                    },
                    complete: function(ret) {
                        _this.css({'pointer-events': 'auto'});
                    },
                    success: function(json) {
                        if(json['ret'] == 200) {
                            if('https://www.huju168.com/experience') {
                                window.location.href='https://www.huju168.com/experience';
                            } else {
                                window.location.href='/';
                            }

                        } else {
                            layer.msg(json['msg']);
                        }
                    },
                    error: function(reg) {
                        console.log(reg);
                    }
                });
            }

        });


        /**
         * 短信发送验证码
         */
        $('.msgYzm').click(function(){
            var _this = $(this);
            var val=_this.attr('data-value');
            var mobile=mobileNoteOBJ.val();

            if(val==1){
                if(!checkMobile(mobile)){
                    boxMsg(boxMsg2OBJ,'手机号错误');
                    return;
                }

                removeBoxMsg();
                sendSms(mobile,3);

                _this.addClass('gray9');
                var count = 60;
                _this.attr('data-value',0);
                sendMsgCountDown(_this,count);
            }else{
                _this.removeClass('gray9');
            }
        });

        // 待激活发送验证码
        $('.msgLoginYzm').click(function() {
            var _this = $(this);
            var val=_this.attr('data-value');
            var mobile=$('#activedMobile').val();

            if(val==1){
                if(!checkMobile(mobile)){
                    layer.msg('手机号错误');
                    return;
                }

                removeBoxMsg();
                sendSms(mobile,5);

                _this.addClass('gray9');
                var count = 60;
                _this.attr('data-value',0);
                sendMsgCountDown(_this,count);
            }else{
                _this.removeClass('gray9');
            }
        });

        autoSubmit('.paw_log', pawLogOBJ); // 回车键密码登录
        autoSubmit('.note_log', noteLogOBJ); // 回车键短信登录

    });

    //短信提示
    function submCheckSms($boxName,val){
        removeBoxMsg();
        if($.trim(val)==''){
            boxMsg($boxName,'请输入验证码');
            return false;
        }
        return true;
    }
    //手机提示
    function submCheckPhone($boxName,val){
        //清除以前样式
        removeBoxMsg();

        if($.trim(val)==''){
            boxMsg($boxName,'请输入用户名');
            return false;
        }else if(!checkMobile(val)){
            boxMsg($boxName,'手机格式错误');
            return false;
        }

        return true;
    }
    //密码提示
    function submCheckPassword($boxName,val){
        //清除以前样式
        removeBoxMsg();

        if($.trim(val)==''){
            boxMsg($boxName,'请输入密码');
            return false;
        }else if(val.length<6){
            boxMsg($boxName,'密码不能少于 6 个字符');
            return false;
        }
        return true;
    }
    //图片验证码提示
    function submCheckCode(boxName,val,codename){
        //清除以前样式
        removeBoxMsg();

        if($.trim(val)==''){
            boxMsg(boxName,'请输入1验证码');
            return false;
        }else if(val.length!=4){
            boxMsg(boxName,'验证码长度必须4位');
            return false;
        }
// else{
//            var t=new Date().getTime();
//            $.getJSON('',{code:val,t:t,code_name:codename},function(json){
//                if(json['ret']<0){
//                    boxMsg(boxName,json['msg']);
//                }
//            });
//        }
        return true;

    }
    /**
     * 提示
     */
    function boxMsg($obj,$text){
        $obj.find('span').html($text);
        $obj.show();
    }
    /**
     * 清除提示
     */
    function removeBoxMsg(){
        boxMsgOBJ.hide();
        boxMsgOBJ.find('span').html('');
    }

</script>
<div class="login-footer">
    <div class="copyright_links">
        <a target="_blank" href="/register-info.html">
            注册协议
        </a>
        <span class="spacer"></span>
        <a class="p-kefu" onclick="openZoosUrl('chatwin');">
            联系客服
        </a>
        <!--<span class="spacer"></span>
        <a target="_blank" title="友情链接" href="/link.html">
            友情链接
        </a>-->
        <span class="spacer"></span>
        <a target="_blank" title="全部分类" href="/class.html">
            全部分类
        </a>
        <!--<span class="spacer"></span>
        <a>
            广告合作
        </a>
        <span class="spacer"></span>
        <a target="_blank" title="商家中心" href="https://seller.huju168.com">
            商家中心
        </a>-->
        <span class="spacer"></span>
        <a target="_blank" title="站点地图" href="/map.html">
            站点地图
        </a>
        <span class="spacer"></span>
        <a target="_blank" title="APP下载" href="/download">
            APP下载
        </a>
    </div>
    <p class="copyright">版权所有  copyright 2017-2022
        <a href="https://www.huju168.com/" title="虎居网上商城">四川蓝海农夫数字科技有限公司</a>   (400028521)
    </p>
    <p class="copyright">
        <a class="beian" rel="nofollow" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=51019002001684">
            <img th:src="@{/picture/58c94020eabf4431b9284ef49fd6bfa2.gif}" />&nbsp;
            <span>川公网安备 51019002001684号</span>
        </a>
        <span class="spacer"></span>
        <a target="_blank" href="http://www.miibeian.gov.cn" rel="nofollow">网站备案/许可证号：蜀ICP备18008634号-1</a>
        <span class="spacer"></span>
        <a target="_blank" href="/edi.html" rel="nofollow">经营许可证：川B2-20180361</a>
    </p>
</div>
<script src="static/js/checkfunction.js" 0="app\assets\AppAsset"></script>
<script src="static/js/smscode.js" 0="app\assets\AppAsset"></script>
<!--<script language="javascript" src="static/js/lsjs.js"></script>
-->
<!-- 百度统计  -->
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?ae46b3aea45eeb954b1d527fc7792211";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

</body>
</html>
